<?php
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=".$name."");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
?>
<table border="1">
	<thead>
		<tr>
			<th>Judul Ujian</th>
			<th>Tanggal</th>
			<th>Nilai</th>
			<th>Mata Pelajaran</th>
			<th>Passing Grade</th>
			<th>Status</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($rows as $row){?>
		<tr>
			<td><?php echo $row->uj_name;?></td>
			<td><?php echo date('d-m-Y', strtotime($row->uj_date));?></td>
			<td><?php echo $row->nilai;?></td>
			<td><?php echo $row->mp_name;?></td>
			<td><?php echo $row->mp_passgrade;?></td>
			<td>
				<?php if($row->nilai >= $row->mp_passgrade){ ?>Lulus
				<?php }else{ ?>Gagal<?php }?>
			</td>
		</tr>
		<?php }?>
	</tbody>
</table>
<?php
session_write_close();
exit;
?>
